翻訳と辞書
Words near each other
・ Do What U Like
・ Do What U Want
・ Do What You Do
・ Do What You Do (Jermaine Jackson song)
・ Do What You Do (Mudvayne song)
・ Do What You Gotta Do
・ Do What You Like
・ Do What You Wanna Do
・ Do What You Want
・ Do What You Want (album)
・ Do What You Want (EP)
・ Do What You Want (OK Go song)
・ Do What You're Told
・ Do What's Good for Me
・ Do Whatever Turns You On
Do while loop
・ Do Without My Love
・ Do Won Chang
・ Do Ya
・ Do Ya (album)
・ Do Ya (Anthony Jasmin song)
・ Do Ya (Jump5 song)
・ Do Ya (K. T. Oslin song)
・ Do Ya (The Move song)
・ Do Ya Do Ya (Wanna Please Me)
・ Do Ya Thang
・ Do Ya Thang (Ice Cube song)
・ Do Ya Thang (Rihanna song)
・ Do Ya Wanna Funk
・ Do Ya/Stay with Me


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Do while loop : ウィキペディア英語版
Do while loop

In most computer programming languages, a do while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given boolean condition at the end of the block. Note though that unlike most languages, Fortran's do loop is actually the same as the for loop.
The ''do while'' construct consists of a process symbol and a condition. First, the code within the block is executed, and then the condition is evaluated. If the condition is true the code within the block is executed again. This repeats until the condition becomes false. Because do while loops check the condition after the block is executed, the control structure is often also known as a post-test loop. Contrast with the while loop, which tests the condition before the code within the block is executed, the do-while loop is an exit-condition loop. This means that the code must always be executed first and then the expression or test condition is evaluated. If it is true, the code executes the body of the loop again. This process is repeated as long as the expression evaluates to true. If the expression is false, the loop terminates and control transfers to the statement following the do-while loop.
It is possible, and in some cases desirable, for the condition to always evaluate to true, creating an infinite loop. When such a loop is created intentionally, there is usually another control structure (such as a break statement) that allows termination of the loop.
Some languages may use a different naming convention for this type of loop. For example, the ] language has a "''repeat until''" loop, which continues to run ''until'' the control expression is true (and then terminates) — whereas a "while" loop runs ''while'' the control expression is true (and terminates once the expression becomes false).
==Equivalent constructs==

do while (condition);

is equivalent to

do_work();
while (condition)

In this manner, the do ... while loop saves the initial "loop priming" with do_work(); on the line before the while loop.
As long as the ''continue'' statement is not used, the above is technically equivalent to the following (though these examples are not typical or modern style):

while (true)

or

LOOPSTART:
do_work();
if (condition) goto LOOPSTART;


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Do while loop」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.